package com.learn.spring_aop.xml_config;

import com.learn.spring_aop.xml_config.target.Target;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class XmlConfig {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-aop.xml");
        Target target = applicationContext.getBean("target", Target.class);
        target.target1();
        
        System.out.println("=======================");
        
        target.target2();
        
        /*
         * advice-before
         * advice-around-before
         * target-func-1
         * advice-around-after
         * advice-after-returning
         * advice-after
         * =======================
         * advice-before
         * advice-around-before
         * target-func-2
         * advice-after-throwing-error
         * advice-after
         * Exception in thread "main" java.lang.RuntimeException
         */
    }
}
